import { NgModule } from '@angular/core'
import { Routes, RouterModule } from '@angular/router'
import { ChargeBackListComponent } from './list/list.component'
import { ChargeBackDetailComponent } from './detail/detail.component'
import { ListReuseGuardClass } from '@shared/classes/ListReuseGuardClass'

const routes: Routes = [
  { path: '', redirectTo: 'list', pathMatch: 'full' },
  {
    path: 'list',
    component: ChargeBackListComponent,
    canActivate: [ListReuseGuardClass],
    data: {
      breadcrumb: 'OPERATION.CHARGEBACK.LIST',
      title: '差错列表',
      titleI18n: 'OPERATION.CHARGEBACK.LIST',
      reuse: true,
    },
  },
  {
    path: ':disputeNum',
    component: ChargeBackDetailComponent,
    data: {
      breadcrumb: 'OPERATION.CHARGEBACK.DETAIL',
      title: '差错详情',
      titleI18n: 'OPERATION.CHARGEBACK.DETAIL',
    },
  },
]

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class ChargeBackRoutingModule {}
